﻿function DSEABIntro()
	ExtraActionBarFrame:SetMovable(true);
	ExtraActionBarFrame:EnableMouse(true);
	ExtraActionBarFrame:RegisterForDrag("LeftButton");
	ExtraActionBarFrame:SetScript("OnDragStart", frame.StartMoving);
	ExtraActionBarFrame:SetScript("OnDragStop", frame.StopMovingOrSizing);
	print "EAB: The new ExtraActionButton on the Ultraxion and Madness of Deathwing fights is now movable! For more options: /eab help";
	SlashCmdList["DSEAB"] = DSEAB_SlashHandler;
	SLASH_DSEAB1, SLASH_DSEAB2 = "/eab", "/extraactionbutton";
end


-- Function for handling slash commands
function DSEAB_SlashHandler(msg, editbox)
	local arg1, arg2, rest = string.split(" ", msg);
	
	if (arg1 == "help") then
		print "Available commands:";
		print "/eab lock/unlock - Locks/unlocks the ExtraActionButton.";
		print "/eab hide/show - Hides/shows the ExtraActionButton.";
		print "/eab small/normal/large/huge - Change the ExtraActionButton's size, making it easier to click.";
		print "/eab keybind x - Keybind the ExtraActionButton, examples: /eab keybind H, /eab keybind SHIFT-I."; 
		print "--";
		print "Change the settings before engaging a boss, some commands do not work in combat--"
				
	    elseif (arg1 == "lock") then
        print "ExtraActionButton is now locked."
        ExtraActionBarFrame:RegisterForDrag("Not working yet");
            
        elseif (arg1 == "unlock") then
        print "ExtraActionButton is now unlocked."
        ExtraActionBarFrame:RegisterForDrag("LeftButton");
            
        elseif (arg1 == "hide") then
        print "ExtraActionButton is now hidden."
        ExtraActionBarFrame:Hide();
        
        elseif (arg1) == "show" then
        print "ExtraActionButton is now shown."
        ExtraActionBarFrame:Show();

	    elseif (arg1) == "large" then
        print "ExtraActionButton's size is set to Large."
        DSEABFrameLargeSize();
		
		elseif (arg1) == "huge" then
        print "ExtraActionButton's size is set to Huge."
        DSEABFrameHugeSize();
        
	    elseif (arg1) == "normal" then
        print "ExtraActionButton's size is set to Normal."
        DSEABFrameNormalSize();
		
		elseif (arg1) == "small" then
        print "ExtraActionButton's size is set to Small."
        DSEABFrameSmallSize();
	  
	    elseif (arg1) == "keybind" then
	    print "ExtraActionButton successfully bound."
		DSEABKey = arg2;
		ok = SetBindingClick(DSEABKey, "ExtraActionButton1");
    end
end


-- Framesize changing
function  DSEABFrameSmallSize()
	ExtraActionButton1:SetSize(35,35);
	end

function  DSEABFrameNormalSize()
	ExtraActionButton1:SetSize(50,50);
	end

function  DSEABFrameLargeSize()
	ExtraActionButton1:SetSize(90,90);
	end
	
function  DSEABFrameHugeSize()
	ExtraActionButton1:SetSize(130,130);
	end